/*
 * ESP32 Bluetooth Audio Receiver - Audio Processor Header
 *
 * Copyright (c) 2025 lianggumei
 *
 * SPDX-License-Identifier: MIT
 */

#ifndef __AUDIO_PROCESSOR_HPP__
#define __AUDIO_PROCESSOR_HPP__

#include <cmath>
#include <cstdint>
#include <cstring>

#include "esp_log.h"

class AudioProcessor {
 public:
  AudioProcessor();
  ~AudioProcessor();

  // Process audio data with volume control
  void ProcessAudioData(const uint8_t* data, size_t len, uint8_t volume);

  // Volume control
  void SetVolume(uint8_t volume);
  uint8_t GetVolume() const;

  // Set I2S writer function
  void SetI2SWriter(void (*writer)(const uint8_t*, size_t));

 private:
  // Internal audio processing
  void ProcessAudioDataInternal(const uint8_t* data, size_t len);

  uint8_t volume_;
  void (*i2s_writer_)(const uint8_t*, size_t);

  static const char* kTag;
};

#endif /* __AUDIO_PROCESSOR_HPP__ */
